package fei.zhou.springboot4.demo5;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * 描述该类- JPA
 *
 * @author zhoufei
 * @class: ConditionConifg
 * @date 2021/1/20 14:49
 * @Verson 1.0 -2021/1/20 14:49
 * @see
 */

@Configuration
public class ConditionConifg {
    @Bean
    @Conditional(WindowsCondition.class) // 1如果是wind系统创建对应的bean
    public SysService windowsListService() {
        return new WindowService();
    }
    
    @Bean
    @Conditional(LinuxCondition.class) // 2如果是Linux系统创建对应的bean
    public SysService linuxListService() {
        return new LinuxService();
    }
    
}
